Skip to content

Comments

Fix parameter name editable flag for existing function parameters #667

Merged
pasindufernando1 merged 2 commits intoballerina-platform:1.5.xfrom
pasindufernando1:179Fix
Feb 2, 2026
Merged

Fix parameter name editable flag for existing function parameters #667
pasindufernando1 merged 2 commits intoballerina-platform:1.5.xfrom
pasindufernando1:179Fix

Conversation

@pasindufernando1
Copy link
Contributor

Purpose

This PR fixes an issue where function parameter names were incorrectly marked as editable: true in the flowDesignService/functionDefinition API for existing parameters in the source code. The editable flag should only be true for template parameters used when adding new parameters, not for parameters that already exist. Removed the unconditional .editable() call in FormBuilder.parameterWithDescription() so that existing parameters with source code locations now correctly have editable: false.

Fixes : wso2/product-ballerina-integrator#179

Screen.Recording.2026-01-30.at.15.33.06.mov

Copilot AI review requested due to automatic review settings January 30, 2026 10:08
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes an issue where function parameter names were incorrectly marked as editable: true in existing function parameters. The fix removes an unconditional .editable() call in the FormBuilder.parameterWithDescription() method, allowing the conditional logic to properly set the editable flag based on whether the parameter has a source code location (token is non-null).

Changes:

  • Removed unconditional .editable() call in FormBuilder.parameterWithDescription() method
  • Updated test expectations to reflect editable: false for existing function parameters with source code locations

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.

Show a summary per file
File Description
FormBuilder.java Removed unconditional .editable() call from parameterWithDescription() method to fix incorrect editable flag
function_def2.json Updated test expectations: parameter variable now has editable: false
function_def3.json Updated test expectations: parameter variables now have editable: false
function_def4.json Updated test expectations: parameter variable now has editable: false
function_def5.json Updated test expectations: parameter variables now have editable: false
function_def6.json Updated test expectations: parameter variables now have editable: false
function_def8.json Updated test expectations: parameter variable now has editable: false
function_def13.json Updated test expectations: parameter variables now have editable: false
function_def14.json Updated test expectations: parameter variables now have editable: false
function_def15.json Updated test expectations: parameter variables now have editable: false
np_function_def1.json Updated test expectations: parameter variables now have editable: false
np_function_def2.json Updated test expectations: parameter variable now has editable: false
np_function_def3.json Updated test expectations: parameter variable now has editable: false

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@nipunayf nipunayf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving this as a temporary fix; may need to revisit it later.

@pasindufernando1 pasindufernando1 merged commit 0321088 into ballerina-platform:1.5.x Feb 2, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants